﻿using System;
using System.Collections.Generic;

namespace _4._9BookDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var aa = new Book(1, "aa", 11.1, "aaaa","11","张三");
            var bb = new Book(2, "bb", 22.2, "bbbb", "22", "小二");
            var cc = new Book(3, "cc", 33.3, "cccc", "33" ,"小三");
            var dd = new Book(4, "dd", 44.4, "dddd", "44", "小四");
            var BK = new List<Book>(20) { aa, bb, cc, dd };
            BK.Add(new Book(66,"二",22.2,"bbb","11","小二"));

            int id2 = BK.FindIndex(p => p.Autor == "张三");
            Book id3 = BK.Find(p => p.Press == "aaaa");
            List<Book> index4 = BK.FindAll(p => p.Autor == "张三");
            foreach (Book a in index4)
            {
                Console.WriteLine($"{a:A}",null);
            }
            Console.WriteLine(id2);
            Console.WriteLine(id3);
            Console.ReadLine();
        }
    }
}
